package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.dubbo.mappers.AnnouncementMapper;
import com.tanhua.model.domain.Announcement;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Description: test
 * @Create by: JJ菜菜
 * @Date: 2021/12/11 17:08
 */

@DubboService
public class AnnouncementApiImpl implements AnnouncementApi{

    @Autowired
    private AnnouncementMapper announcementMapper;

    @Override
    public List<Announcement> findAll(Integer page, Integer pagesize) {


        IPage<Announcement> ipage = new Page<>();
        IPage<Announcement> pages = announcementMapper.selectPage(ipage, null);
        List<Announcement> records = pages.getRecords();
        return records;
    }
}
